/*
 *英才会硕信息科技有限公司拥有本软件的版权，拥有本软件版权2025   并保留所有权利。
 *Copyright 2021,YCHS Information&Science Technology Co.,Ltd,
 *All rights reserved.
 */
package com.ychs.lawyerback01.mapper;

import com.ychs.lawyerback01.dto.UserOptDTO;
import com.ychs.lawyerback01.dto.UserQueryDTO;
import com.ychs.lawyerback01.pojo.UserEntity;
import com.ychs.lawyerback01.vo.UserQueryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author xuehongjin
 * @version 1.0
 * @date 2025/8/7
 */
@Mapper
public interface UserMapper {
    UserEntity getUserByUsername(String username);

    List<UserQueryVo> getUsersByCondition(UserQueryDTO userQueryDTO);

    int getCountByCondition(UserQueryDTO userQueryDTO);

    int addUser(UserEntity userOptDTO);

    int editUser(UserEntity userEntity);

    int deleteUser(List<Long> ids);
   @Select("select id,username,realName,phone,sex,flag,remark,roleId from user where id =#{userId}" )
    UserEntity getUserByUserId(Long userId);
    UserEntity getUserByIdCard(@Param("idCard") String idCard);
    UserEntity getUserByPracticeCertNo(@Param("practiceCertNo") String practiceCertNo);
    UserEntity getUserByIdCardExceptId(@Param("idCard") String idCard, @Param("id") Long id);
    UserEntity getUserByPracticeCertNoExceptId(@Param("practiceCertNo") String practiceCertNo, @Param("id") Long id);



}
